package com.dxx.cloud.admin.controller.admin;

import com.dxx.cloud.admin.module.response.qiniu.QiNiuTokenResponse;
import com.dxx.cloud.admin.service.qiniu.QiniuService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.dromara.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/fileUpload")
@Tag(name = "文件上传模块")
public class FileController {

    @Autowired
    private QiniuService qiniuService;

    @Operation(method = "获取七牛token")
    @PostMapping("/qiniuToken")
    public R<QiNiuTokenResponse> qiniuSign() throws Exception {
        return R.ok(qiniuService.generateToken());
    }
}
